import request from '@/utils/request';

// 1. 上传图片
export const uploadImage = async (data: any, options?: API.baseOption) =>
  request('/codemuse_api/codemuse/chat/uploadImage', {
    method: 'POST',
    data,
    requestType: 'form',
    ...(options || {}),
  });

// 2.2.3.1 CHAT 列表
export const conversationList = async (data: any, options?: API.baseOption) =>
  request('/codemuse_api/codemuse/conversation/list', {
    method: 'GET',
    data,
    ...(options || {}),
  });

// 2.2.3.4 会话历史消息查询(查询会话的内容)
export const queryMessagesByConversationId = async (
  data: any,
  options?: API.baseOption,
) =>
  request('/codemuse_api/codemuse/message/queryMessagesByConversationId', {
    method: 'GET',
    data,
    ...(options || {}),
  });

// 2.2.3.3 生成代码
export const createPageHtml = async (data: any, options?: API.baseOption) =>
  request('/codemuse_api/codemuse/chat/createPageHtml', {
    method: 'POST',
    data,
    ...(options || {}),
  });

// 2.2.3.2 描述页面结构(用于创建描述页面结构)
export const describePageStructure = async (
  data: any,
  options?: API.baseOption,
) =>
  request('/codemuse_api/codemuse/chat/describePageStructure', {
    method: 'POST',
    data,
    ...(options || {}),
  });

export const conversationDelete = async (id: any, options?: API.baseOption) =>
  request(`/codemuse_api/codemuse/conversation/delete/${id}`, {
    method: 'DELETE',
    ...(options || {}),
  });

// 2.2.1.4 项目列表查询接口
export const getProjectList = async (id: any, options?: API.baseOption) =>
  request('/codemuse_api/codemuse/project/list', {
    method: 'GET',
    ...(options || {}),
  });

// 2.2.3.6 项目下拉查询
export const getDropDownList = async (id: any, options?: API.baseOption) =>
  request('/codemuse_api/codemuse/requirement/dropDownList', {
    method: 'GET',
    ...(options || {}),
  });

export const getDetail = async (id: any, options?: API.baseOption) =>
  request(`/codemuse_api/codemuse/conversation/detail/${id}`, {
    method: 'GET',
    ...(options || {}),
  });
